function showZoomImg(domName,model){var len=0;var domImg;var arrPic=new Array;var arrPic_name=new Array;var arrPic_dous=new Array;var arrName=new Array;var num=0;var numNow=1;var leftPoint;var rightPoint;var spin_n=0;var zoom_n=1;showModel(model);function showModel(model){if(model=="img")$("body").on("click",domName,function(){$("body").css("overflow-y","hidden");domImg=$(this).parents(".zoomImgBox").find(domName);len=domImg.length;arrPic=[];arrPic_name=[];arrPic_dous=[];arrName=[];for(var i=0;i< len;i++){if(!$(domImg.eq(i)).attr("src"))break;arrPic[i]=domImg.eq(i).attr("src");arrPic_name[i]=domImg.eq(i).attr("name_title");arrPic_dous[i]=domImg.eq(i).attr("docs_title");if(domImg.eq(i).attr("data-caption"))arrName[i]=domImg.eq(i).attr("data-caption");else arrName[i]="\u56fe\u7247"+(i+1)}len=arrName.length;var img_index=domImg.index(this);num=img_index;numNow=num+1;addMaskLater()});else if(model=="text")$("body").on("click",domName,function(){domImg=$(this).children(".zoomImg-hide-box").find("img"); len=domImg.length;if(len<1){layui.use("layer",function(){var layer=layui.layer;layer.msg("\u6682\u672a\u4e0a\u4f20\u8d44\u6599\u56fe\u7247")});return}num=0;numNow=1;arrPic=[];arrName=[];for(var i=0;i1)showSmall();else{$(".img-pre").css("display", "none");$(".img-next").css("display","none")}var color=$(".LA24664 .banner-docs").css("color");$(".mask-layer-container .img-pre").mouseover(function(){$(".mask-layer-container .img-pre .icon").css("color",color);$(".mask-layer-container .img-pre .iconpth").css("fill","currentColor");$(".mask-layer-container .img-pre .iconpth").css("color","inherit")});$(".mask-layer-container .img-pre").mouseleave(function(){$(".mask-layer-container .img-pre").css("color","unset");$(".mask-layer-container .img-pre .iconpth").css("fill", "white")});$(".mask-layer-container .img-next").mouseover(function(){$(".mask-layer-container .img-next .icon").css("color",color);$(".mask-layer-container .img-next .iconpth").css("fill","currentColor");$(".mask-layer-container .img-next .iconpth").css("color","inherit")});$(".mask-layer-container .img-next").mouseleave(function(){$(".mask-layer-container .img-next").css("color","unset");$(".mask-layer-container .img-next .iconpth").css("fill","white")});showImg();showCtrl()}function showImg(){$(".mask-layer-imgbox").empty(); if(num>=len)num=num%len;var imgCont='\x3cdiv class\x3d"mask-layer-imgName"\x3e'+arrName[num]+"\x3c/div\x3e"+'\x3cdiv class\x3d"layer-img-box"\x3e\x3cdiv class\x3d"layerImbox"\x3e\x3cimg src\x3d"'+arrPic[num]+'" alt\x3d""\x3e\x3c/div\x3e\x3cdiv class\x3d"layername"\x3e'+arrPic_name[num]+'\x3c/div\x3e\x3cdiv class\x3d"layerdouc"\x3e'+arrPic_dous[num]+"\x3c/div\x3e\x3c/div\x3e";$(".mask-layer-imgbox").append(imgCont);var color=$(".LA24664 .banner-docs").css("color");$(".layername").css("color",color)} function showCtrl(){$(".img-pre").on("click",function(){num--;if(num==-1)num=len-1;showImg()});$(".img-next").on("click",function(){num++;if(num==len){num=0;boxReset()}showImg()});$(".mask-layer-close").click(function(){$(".mask-layer").remove();$("body").css("overflow-y","auto")});$(document).keyup(function(event){switch(event.keyCode){case 27:$(".mask-layer").remove()}$("body").css("overflow-y","auto")});if(arrPic.length>1)showSmallThis();function showSmallThis(){$(".mask-small-img").removeClass("onthis"); $($(".mask-small-img")[num]).addClass("onthis")}$(".mask-small-img").on("click",function(){num=$(".mask-small-img").index(this);showImg();showSmallThis()});$(".box-go-left").on("click",function(){boxGoRight()});$(".box-go-right").on("click",function(){boxGoLeft()});function boxGoLeft(intTime){intTime?intTime:intTime=1;if(leftPoint>0){$(".small-img-box").animate({left:"-\x3d"+630*intTime},500);leftPoint=leftPoint-intTime;rightPoint=rightPoint+intTime}}function boxGoRight(){if(rightPoint>0){$(".small-img-box").animate({left:"+\x3d630"}, 500);leftPoint++;rightPoint--}}function allowShow(){var boxLeft=$(".small-content").offset().left;var thisLeft=$(".mask-small-img.onthis").offset().left;var intTime=Math.floor((thisLeft-boxLeft)/630);if(thisLeft-boxLeft>=630)boxGoLeft(intTime);else if(thisLeft=winWidth&&mouseY+menuHeight+minEdgeMargin>=winHeight){menuLeft=mouseX-menuWidth-minEdgeMargin+"px";menuTop=mouseY-menuHeight-minEdgeMargin+"px"}else if(mouseX+menuWidth+minEdgeMargin>=winWidth){menuLeft=mouseX-menuWidth-minEdgeMargin+"px";menuTop= mouseY+minEdgeMargin+"px"}else if(mouseY+menuHeight+minEdgeMargin>=winHeight){menuLeft=mouseX+minEdgeMargin+"px";menuTop=mouseY-menuHeight-minEdgeMargin+"px"}else{menuLeft=mouseX+minEdgeMargin+"px";menuTop=mouseY+minEdgeMargin+"px"}$(".mask-layer .contextmenu").css({"left":menuLeft,"top":menuTop}).show();return false});$(document).click(function(){$(".contextmenu").hide()})}}function imgInit(){zoom_n=1;var $div_img=$(".layer-img-box img");$div_img.bind("mousedown",function(event){event.preventDefault&& event.preventDefault();var offset_x=$(this)[0].offsetLeft;var offset_y=$(this)[0].offsetTop;var mouse_x=event.pageX;var mouse_y=event.pageY;$(".layer-img-box").bind("mousemove",function(ev){var _x=ev.pageX-mouse_x;var _y=ev.pageY-mouse_y;var now_x=offset_x+_x+"px";var now_y=offset_y+_y+"px";$div_img.css({top:now_y,left:now_x})});$(".layer-img-box").bind("mouseup",function(){$(".layer-img-box").unbind("mousemove")})})}function showSmall(){leftPoint=Math.ceil(arrPic.length/6)-1;rightPoint=0;setImgPhoto; arrPic=setImgPhoto(arrPic);$(".mask-layer-imgbox").addClass("has-small");var sDom="\x3cdiv class\x3d'small-content'\x3e\x3cdiv class\x3d'small-img-box'\x3e\x3c/div\x3e\x3c/div\x3e";$(".mask-layer-container").append(sDom);for(var i=0;i6){$(".small-img-box").width(Math.ceil(arrPic.length/6)*630);$(".small-content").append('\x3cspan class\x3d"box-go-left"\x3e\x3c/span\x3e\x3cspan class\x3d"box-go-right"\x3e\x3c/span\x3e')}} }function setImgPhoto(arr){let newArr=[];for(var i=0;i=0&&_end>=0){var _urlNum=strUrl.substring(_state,_end);var reg=new RegExp(_urlNum);arr[i]=arr[i].replace(reg,"")}newArr.push(arr[i])}return newArr} function ArrayToHeavy(arr){let newArr=[];for(var i=0;i